<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Nvm管理node版本 | 个人文档</title>
    <meta name="generator" content="VuePress 1.8.2">
    
    <meta name="description" content="练习文档">
    
    <link rel="preload" href="/mybook/assets/css/0.styles.d89b46bb.css" as="style"><link rel="preload" href="/mybook/assets/js/app.17367f93.js" as="script"><link rel="preload" href="/mybook/assets/js/2.0cc5fd8f.js" as="script"><link rel="preload" href="/mybook/assets/js/11.b5a55ccb.js" as="script"><link rel="prefetch" href="/mybook/assets/js/10.0ab847e7.js"><link rel="prefetch" href="/mybook/assets/js/3.f9542c36.js"><link rel="prefetch" href="/mybook/assets/js/4.682dc1df.js"><link rel="prefetch" href="/mybook/assets/js/5.f403064b.js"><link rel="prefetch" href="/mybook/assets/js/6.0a6170cc.js"><link rel="prefetch" href="/mybook/assets/js/7.b7420e90.js"><link rel="prefetch" href="/mybook/assets/js/8.03ff30b2.js"><link rel="prefetch" href="/mybook/assets/js/9.a5d94e25.js">
    <link rel="stylesheet" href="/mybook/assets/css/0.styles.d89b46bb.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/mybook/" class="home-link router-link-active"><!----> <span class="site-name">个人文档</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/mybook/" class="nav-link">
  Home
</a></div><div class="nav-item"><a href="/mybook/guide/" class="nav-link">
  Guide
</a></div><div class="nav-item"><a href="https://google.com" target="_blank" rel="noopener noreferrer" class="nav-link external">
  External
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="Languages" class="dropdown-title"><span class="title">Languages</span> <span class="arrow down"></span></button> <button type="button" aria-label="Languages" class="mobile-dropdown-title"><span class="title">Languages</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/mybook/language/chinese.html" class="nav-link">
  Chinese
</a></li><li class="dropdown-item"><!----> <a href="/mybook/language/japanese.html" class="nav-link">
  Japanese
</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="高级" class="dropdown-title"><span class="title">高级</span> <span class="arrow down"></span></button> <button type="button" aria-label="高级" class="mobile-dropdown-title"><span class="title">高级</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><h4>
          算法
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/mybook/language/chinese.html" class="nav-link">
  冒泡
</a></li><li class="dropdown-subitem"><a href="/mybook/language/japanese.html" class="nav-link">
  快速
</a></li></ul></li><li class="dropdown-item"><h4>
          设计模式
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/mybook/language/chinese.html" class="nav-link">
  工厂
</a></li><li class="dropdown-subitem"><a href="/mybook/language/chinese.html" class="nav-link">
  单例
</a></li></ul></li></ul></div></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/mybook/" class="nav-link">
  Home
</a></div><div class="nav-item"><a href="/mybook/guide/" class="nav-link">
  Guide
</a></div><div class="nav-item"><a href="https://google.com" target="_blank" rel="noopener noreferrer" class="nav-link external">
  External
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="Languages" class="dropdown-title"><span class="title">Languages</span> <span class="arrow down"></span></button> <button type="button" aria-label="Languages" class="mobile-dropdown-title"><span class="title">Languages</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/mybook/language/chinese.html" class="nav-link">
  Chinese
</a></li><li class="dropdown-item"><!----> <a href="/mybook/language/japanese.html" class="nav-link">
  Japanese
</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="高级" class="dropdown-title"><span class="title">高级</span> <span class="arrow down"></span></button> <button type="button" aria-label="高级" class="mobile-dropdown-title"><span class="title">高级</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><h4>
          算法
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/mybook/language/chinese.html" class="nav-link">
  冒泡
</a></li><li class="dropdown-subitem"><a href="/mybook/language/japanese.html" class="nav-link">
  快速
</a></li></ul></li><li class="dropdown-item"><h4>
          设计模式
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/mybook/language/chinese.html" class="nav-link">
  工厂
</a></li><li class="dropdown-subitem"><a href="/mybook/language/chinese.html" class="nav-link">
  单例
</a></li></ul></li></ul></div></div> <!----></nav>  <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>Nvm管理node版本</span> <!----></p> <!----></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="nvm管理node版本"><a href="#nvm管理node版本" class="header-anchor">#</a> Nvm管理node版本</h1> <h3 id="确认安装完成"><a href="#确认安装完成" class="header-anchor">#</a> 确认安装完成</h3> <p>打开cmd,</p> <p>输入下面命令,安装成功则显示版本号和列出了各种使用命令。</p> <div class="language- extra-class"><pre class="language-text"><code>nvm -v
</code></pre></div><p><img src="https://gitee.com/banjieming/img/raw/master//image-20210825145700281.png" alt="image-20210825145700281"></p> <h3 id="使用"><a href="#使用" class="header-anchor">#</a> 使用</h3> <p>1.列出所有已经安装的Node版本</p> <div class="language- extra-class"><pre class="language-text"><code>nvm ls
</code></pre></div><p><img src="https://gitee.com/banjieming/img/raw/master//image-20210825145736862.png" alt="image-20210825145736862"></p> <p>2.安装最新版 Node</p> <div class="language- extra-class"><pre class="language-text"><code>nvm install node
</code></pre></div><p>3.列出所有可以安装的Node版本号</p> <div class="language- extra-class"><pre class="language-text"><code>nvm list available
</code></pre></div><p>4.安装指定版本号的Node</p> <div class="language- extra-class"><pre class="language-text"><code>nvm install 11.13.0
</code></pre></div><p>5.使用特定版本的Node</p> <div class="language- extra-class"><pre class="language-text"><code>nvm use 11.13.0
</code></pre></div><p>卸载版本号的Node</p> <div class="language- extra-class"><pre class="language-text"><code>nvm uninstall 11.13.0
</code></pre></div><h3 id="命令提示翻译"><a href="#命令提示翻译" class="header-anchor">#</a> 命令提示翻译</h3> <div class="language- extra-class"><pre class="language-text"><code>nvm arch ：显示node是运行在32位还是64位。
nvm install &lt;version&gt; [arch] ：安装node， version是特定版本也可以是最新稳定版本latest。可选参数arch指定安装32位还是64位版本，默认是系统位数。可以添加--insecure绕过远程服务器的SSL。
nvm list [available] ：显示已安装的列表。可选参数available，显示可安装的所有版本。list可简化为ls。
nvm on ：开启node.js版本管理。
nvm off ：关闭node.js版本管理。
nvm proxy [url] ：设置下载代理。不加可选参数url，显示当前代理。将url设置为none则移除代理。
nvm node_mirror [url] ：设置node镜像。默认是https://nodejs.org/dist/。如果不写url，则使用默认url。设置后可至安装目录settings.txt文件查看，也可直接在该文件操作。
nvm npm_mirror [url] ：设置npm镜像。https://github.com/npm/cli/archive/。如果不写url，则使用默认url。设置后可至安装目录settings.txt文件查看，也可直接在该文件操作。
nvm uninstall &lt;version&gt; ：卸载指定版本node。
nvm use [version] [arch] ：使用制定版本node。可指定32/64位。
nvm root [path] ：设置存储不同版本node的目录。如果未设置，默认使用当前目录。
nvm version ：显示nvm版本。version可简化为v。
</code></pre></div><hr> <p>参考博客:
https://www.cnblogs.com/antao/p/12543533.html</p></div> <footer class="page-edit"><!----> <!----></footer> <!----> </main></div><div class="global-ui"></div></div>
    <script src="/mybook/assets/js/app.17367f93.js" defer></script><script src="/mybook/assets/js/2.0cc5fd8f.js" defer></script><script src="/mybook/assets/js/11.b5a55ccb.js" defer></script>
  </body>
</html>
